import { Inject, Controller, Post, Body } from '@midwayjs/decorator';
import { Context } from '@midwayjs/koa'
import { adminService } from '../service/admin.service';
import { classDTO } from '../dto/classitem';

/**
 * 描述
 */
@Controller('/admin')
export class APIController {
    @Inject()
    ctx: Context;
    @Inject()
    adminService: adminService;
    @Post('/addclassitem')
    async addclassitem(@Body() body: classDTO) {
        return this.adminService.addclass(body.name)
    }
}